<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <style>
        #advert {
            width: 300px;
            height: 200px;
            background-color: pink;
            border: 1px solid #000;
            position: absolute;
            right: 0;
            bottom: 0;
        }

        #close {
            position: absolute;
            left: 0;
            top: 0;
        }
    </style>
    <div id="advert">
        <button id="close">关闭</button>
    </div>
</body>
<script type="text/javascript">
    // 广告弹出窗(自动关闭)
    document.querySelector('#close').onclick = function(){
        document.querySelector('#advert').style.display = 'none';
        setTimeout(function(){
            document.querySelector('#advert').style.display = 'block';
        },4000);
    }
</script>

</html>